using Avalonia;
using Avalonia.Controls;
using Avalonia.Markup.Xaml;
using System.Threading.Tasks;
using System;
using Avalonia.Interactivity;

namespace ScreenshotWindow;

public partial class ToolBarView : UserControl
{
    public event Func<Task> OnSaveClicked;
    public event Func<Task> OnCopyClicked;
    public event Action OnCancelClicked;
    public ToolBarView()
    {
        InitializeComponent();
    }
    private async void Save_Click(object? sender, RoutedEventArgs e)
          => await (OnSaveClicked?.Invoke() ?? Task.CompletedTask);

    private async void Copy_Click(object? sender, RoutedEventArgs e)
        => await (OnCopyClicked?.Invoke() ?? Task.CompletedTask);

    private void Cancel_Click(object? sender, RoutedEventArgs e)
        => OnCancelClicked?.Invoke();
}